import Vue from "vue";
import VueRouter from "vue-router";
import HomeView from "../views/HomeView.vue";

// 引入一级路由
import UiRouter from "@/views/First/UiRouter.vue";
import Contacts from "@/views/First/Contacts.vue";
import About from "@/views/First/About.vue";
// 引入二级路由
import AllContacts from "@/views/Second/All_contacts";
import Alice from "@/views/Second/Alice.vue";
import Bob from "@/views/Second/Bob.vue";
// 引入三级路由
import Blog from "@/views/Three/Blog.vue";
import Fax from "@/views/Three/Fax.vue";
Vue.use(VueRouter);

const routes = [
  {
    path: "/uirouter",
    component: UiRouter,
  },
  {
    path: "/contacts",
    component: Contacts,
    children: [
      {
        path: "allcontacts",
        component: AllContacts,
      },
      {
        path: "alice",
        component: Alice,
      },
      {
        path: "bob",
        component: Bob,
        // 三级路由
        children: [
          {
            path: "blog",
            component: Blog,
          },
          {
            path: "fax",
            component: Fax,
          },
        ],
      },
    ],
  },
  {
    path: "/about",
    component: About,
  },
];

const router = new VueRouter({
  routes,
});

export default router;
